-- common..p_Get_InvoiceDetails '1507'
use common
go
IF OBJECT_ID('dbo.p_Get_InvoiceDetails') IS NOT NULL
BEGIN
    DROP PROCEDURE dbo.p_Get_InvoiceDetails
    IF OBJECT_ID('dbo.p_Get_InvoiceDetails') IS NOT NULL
        PRINT '<<< FAILED DROPPING PROCEDURE dbo.p_Get_InvoiceDetails >>>'
    ELSE
        PRINT '<<< DROPPED PROCEDURE dbo.p_Get_InvoiceDetails >>>'
END
go
create proc p_Get_InvoiceDetails
(
	@InvoiceNumber			varchar(200)	= null 	-- InvoiceNumber
) as
begin

		select * from common..t_SalesOrder where InvoiceNumber = @InvoiceNumber	
		return 0
end
go
EXEC sp_procxmode 'dbo.p_Get_InvoiceDetails','unchained'
go
IF OBJECT_ID('dbo.p_Get_InvoiceDetails') IS NOT NULL
    PRINT '<<< CREATED PROCEDURE dbo.p_Get_InvoiceDetails >>>'
ELSE
    PRINT '<<< FAILED CREATING PROCEDURE dbo.p_Get_InvoiceDetails >>>'
go
GRANT EXECUTE ON dbo.p_Get_InvoiceDetails TO public
go